<!DOCTYPE html>
<html>

<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title>flv.js demo</title>
    <style>
        .divVideo {
            position: relative;
            width: 100%;
            padding-bottom: 40%;
        }

        video {
            position: absolute;
            left: 1%;
            top: 0;
            width: 50%;
            object-fit: fill;
        }
    </style>
</head>

<body>
    <div class="divVideo">
        <video id="videoElement" controls autoplay>Your browser is too old which doesn't support HTML5 video.</video>
    </div>
    <br>
    <script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
    <div class="divVideo">
        <video id="videoElement"></video></div>
    <script>
        if (flvjs.isSupported()) {
            var videoElement = document.getElementById('videoElement');
            var flvPlayer = flvjs.createPlayer({
                type: 'flv',
                url: '/natlgeo/live.flv'
            });
            flvPlayer.attachMediaElement(videoElement);
            flvPlayer.load();
            flvPlayer.play();
        }
    </script>
</body>

</html>